package my.service;

import my.model.Category;

import java.util.List;

/**
 * Created by Administrator on 2017/4/20 0020.
 */
public class CategoryService {
/*
    public Page<Category> paginateAllCategories() {

    }*/

    public List<Category> getAllCategories() {
        List<Category> categories = Category.dao.find("SELECT * FROM category");
        return categories;
    }

    public boolean updateCategory(Category category) {
        boolean success = false;
        try {
            category.update();
            success = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success;
    }

}
